package com.k.kppcloud.consumer.feign.fallback;

import com.k.kppcloud.consumer.feign.HelloService;
import org.springframework.cloud.openfeign.FallbackFactory;

import java.util.List;

public class HelloFallback implements FallbackFactory<HelloService> {
    @Override
    public HelloService create(Throwable cause) {
        return new HelloService() {
            @Override
            public String sayHelloParams(List<String> userNameList) {
                System.err.println("invoke error: sayHelloParams");
                return "invoke error: sayHelloParams";
            }

            @Override
            public String sayHello() {
                System.err.println("invoke error: sayHello");
                return "invoke error: sayHello";
            }
        };
    }
}
